package com.rimi.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.rimi.bean.Menu;
import com.rimi.bean.User;
import com.rimi.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttribute;
import org.springframework.web.bind.annotation.SessionAttributes;

import java.util.List;

@Controller
@SessionAttributes("nowUser")
public class IndexController {

    @Autowired
    private MenuService menuService;

    @RequestMapping("login")
    public String toLogin(){
        return "login";
    }

    @RequestMapping("userLogin")
    @ResponseBody
    public void userLogin(String username,String password,Model model){
        User user = new User();
        user.setUserId(5);
        model.addAttribute("nowUser",user);
    }

    @RequestMapping("index")
    public String toIndex(Model model){return "index";}


    @RequestMapping("playpage")
    public String toPlayBack(){
        return  "playback_page";
    }
}
